<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('采摘任务')"/>
    <link rel="stylesheet" th:href="@{/msg-layer/naranja.min.css}">
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="btn-group-sm" id="toolbar-precheck" role="group">
            <h3 class="inline">采摘任务：</h3>
        </div>
        <div class="col-sm-12 select-table table-striped ">
            <table id="bootstrap-table-1" data-mobile-responsive="true"></table>
    </div>

</div>

<div th:include="include :: footer"></div>
<script th:src="@{/webjars/sockjs-client/1.0.2/sockjs.min.js}"></script>
<script th:src="@{/webjars/stomp-websocket/2.3.3/stomp.min.js}"></script>
<script th:src="@{/msg-layer/naranja.js}"></script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncCheck:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncCheck:remove')}]];
    var prefix = ctx + "system/ncCheck";

    initPreCheck();

    /*初始化待检测列表*/
    function initPreCheck() {
        var prefix = ctx + "system/ncOrderCf";
        var datas = [[${@dict.getType('cforderType')}]];
        var cforderStatus = [[${@dict.getType('cforderStatus')}]];
        var normal_unit = [[${@dict.getType('normal_unit')}]];

        var options = {
            url: prefix + "/list?cforderStatus=2",//待检测
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "菜房订单",
            pageSize: 1000,
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            id: 'bootstrap-table-1',
            toolbar: 'toolbar-precheck',
            columns: [{
                checkbox: true
            },
                {
                    field: 'cforderId',
                    title: '主键',
                    visible: false
                },
                {
                    title: '序号',
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                }, {
                    field: 'cforderCode',
                    title: '订单编号',
                    sortable: true
                },
                {
                    field: 'cropNameCn',
                    title: '采摘内容',
                    formatter: function (value, row, index) {
                        return row.cropNameCn + "--" + row.cropVarietiesCn + "--" + row.requestAmount + "(" + $.table.selectDictLabel(normal_unit, row.unit) + ")";
                    }
                },
                {
                    field: 'requestTime',
                    title: '需求日期',
                    formatter: function (value, row, index) {
                        return dateFtt(value);
                    }
                },
                {
                    field: 'cforderType',
                    title: '订单类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'remark',
                    title: '备注',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                }
]
        };
        $.table.init(options);
        /*状态:1：待确认 2：已挂起 3：已确认：4：已生成订单*/
    }

    function reload() {
        $.table.refresh();
    }

    setTitle("采摘任务", true)
</script>
</body>
</html>